
/*
The syntax that follows replicates all the tables and figures in:

Christopher Wlezien and Stuart Soroka. 2012. "Political Institutions 
and the Opinion-Policy Link," West European Politics 35(6): 1407-1432.

The dataset is in STATA 12 format, and is saved as Wlezien&Soroka.dta.  
It includes all the variables required to run the models below, alongside 
a few additional macroeconomic variables.

Please cite the above paper where appropriate, noting that data were
made available by the authors at degreesofdemocracy.net.
*/


****************************************************
*FIGURE 1.
graph twoway scatter dprefs1 dperclspendgdp if wave==4 & domain==5, mlab(country) mlabp(12)/*
*/ scheme(s1mono) symbol(o)  /*
*/ xlab(, labsize(small) ) xscale(range(-17.5 6)) ylab(,labsize(small) angle(0)) /*
*/ xtitle("% Change in Spending/GDP (~1996-2006)", margin(0 0 0 2)) /*
*/ ytitle("Change in Net Support for Spending (~1996-2006)", margin(0 2 0 0))


****************************************************
*FIGURE 2.
graph twoway scatter dperclspendgdp lprefs1 if wave==4 & domain==5, mlab(country) mlabp(12)/*
*/ scheme(s1mono) symbol(o)  /*
*/ xlab(, labsize(small) ) xscale(range(-85 5)) ylab(,labsize(small) angle(0)) yscale(range(-17.5 6))/*
*/ xtitle("Levels of Net Support for Spending (~1996)", margin(0 0 0 2)) /*
*/ ytitle("% Change in Spending/GDP (~1996-2006)", margin(0 2 0 0))


****************************************************
*TABLE 1. ANOVAS
anova prefs1 year country if domain==5
anova gv_all year country if domain==5
anova unemp year country if domain==5 & l.prefs1~=.
anova spendgdp year country if domain==5 & l.prefs1~=.
anova percspend2defl year country if domain==5 & l.prefs1~=.


****************************************************
*TABLE 2. BASIC PUBLIC RESPONSIVENESS MODEL, USING MLE
*AND SPENDING OVER GDP

set more off
*JUST CURRENT PER CAPITA SPENDING
xtreg prefs1 spendgdp if domain==5 & spend~=., mle re
estimates store A
*ADDING GOVT AND UNEMPLOYMENT
xtreg prefs1 spendgdp gv_all unemp if domain==5 & spend~=., mle re
estimates store B
*ADDING LAGGED PREFS
xtreg prefs1 spendgdp gv_all unemp lprefs if domain==5 & spend~=., mle re
estimates store C
esttab A B C , b(%7.3f) se star(* .10 ** .05)


****************************************************
*TABLE 3. INTERACTING WITH FEDERALISM

set more off
*without net preferences
xi3: xtreg prefs1 spendgdp*rodden_v5 gv_all unemp if domain==5 & spend~=., mle re
estimates store A
*with net preferences
xi3: xtreg prefs1 spendgdp*rodden_v5 gv_all unemp lprefs if domain==5 & spend~=., mle re
estimates store B
esttab A B , b(%7.3f) se star(* .10 ** .05)
    
    
****************************************************
*TABLE 4. FIND ESTIMATED FEEDBACK COEFFICIENT    
xtreg prefs1 c.spendgdp##c.rodden_v5 c.gv_all c.unemp if domain==5 & spend~=., mle re
su rodden_v5 if domain==5 & year==2000, detail
lincom spendgdp+(9*c.spendgdp#c.rodden_v5)
lincom spendgdp+(13*c.spendgdp#c.rodden_v5)
lincom spendgdp+(32*c.spendgdp#c.rodden_v5)


****************************************************
*TABLE 5. BASIC POLICY REPRESENTATION MODEL, USING MLE

set more off
*JUST LAGGED PREFERENCES
xtreg percspend2defl l.prefs1 if domain==5 & D.spend~=. , mle re
estimates store A
*ADDING PERCENTAGE CHANGE IN GDP
xtreg percspend2defl l.prefs1 l.percgdpdefl if domain==5 & D.spend~=., mle re
estimates store B
*ADDING PERCENTAGE CHANGE IN DEBT 
xtreg percspend2defl l.prefs1 l.percgdpdefl l.percdebtdefl if domain==5 & D.spend~=., mle re
estimates store C
esttab A B C , b(%7.3f) se star(* .10 ** .05) 

    
****************************************************
*TABLE A4. BASIC POLICY REPRESENTATION MODEL, USING MLE
*AGAIN, WITH PARTISANSHIP

set more off
*JUST LAGGED PREFERENCES
xtreg percspend2defl l.prefs1 if domain==5 & D.spend~=. , mle re
estimates store A
*ADDING PARTISANSHIP
xtreg percspend2defl l.prefs1 l.gov_left2 if domain==5 & D.spend~=. , mle re
estimates store B
*ADDING PERCENTAGE CHANGE IN GDP
xtreg percspend2defl l.prefs1 l.gov_left2 l.percgdpdefl if domain==5 & D.spend~=., mle re
estimates store C
*ADDING PERCENTAGE CHANGE IN DEBT 
xtreg percspend2defl l.prefs1 l.gov_left2 l.percgdpdefl l.percdebtdefl if domain==5 & D.spend~=., mle re
estimates store D
esttab B C D, b(%7.3f) se star(* .10 ** .05) 


****************************************************
*TABLE 6. ADDING INTERACTIONS WITH PROPORTIONALITY AND PRESIDENTIALISM

set more off
*interaction with Golder's effective number of parliamentary parties
xi3: xtreg percspend2defl  Lprefs1*golder_enpp l.percgdpdefl l.percdebtdefl if domain==5 & D.spend~=., mle re
estimates store A
*interaction with Lijphart's presidential variable
xi3: xtreg percspend2defl Lprefs1*lijphart_execdom l.percgdpdefl l.percdebtdefl if domain==5 & D.spend~=., mle re
estimates store B
*interacting with both
xi3: xtreg percspend2defl Lprefs1*golder_enpp Lprefs1*lijphart_execdom l.percgdpdefl l.percdebtdefl if domain==5 & D.spend~=., mle re
estimates store C
esttab A B C, b(%7.3f) se star(* .10 ** .05) 



****************************************************
*TABLE 7. IMPLIED REPRESENTATION COEFFICIENTS
xtreg percspend2defl c.Lprefs1##c.golder_enpp c.Lprefs1##c.lijphart_execdom cl.percgdpdefl cl.percdebtdefl if domain==5 & D.spend~=., mle re
su golder_enpp lijphart_execdom if domain==5 & year==2000, detail
*IMPACT OF ENPP
lincom c.Lprefs1+(2.74*c.Lprefs1#c.golder_enpp)
lincom c.Lprefs1+(3.34*c.Lprefs1#c.golder_enpp)
lincom c.Lprefs1+(3.93*c.Lprefs1#c.golder_enpp)
*IMPACT OF EXECUTIVE DOMINANCE
lincom c.Lprefs1+(2.09*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(2.86*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(4.36*c.Lprefs1#c.lijphart_execdom)
*IMPACT OF BOTH
lincom c.Lprefs1+(2.74*c.Lprefs1#c.golder_enpp)+(2.09*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(2.74*c.Lprefs1#c.golder_enpp)+(2.86*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(2.74*c.Lprefs1#c.golder_enpp)+(4.36*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.34*c.Lprefs1#c.golder_enpp)+(2.09*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.34*c.Lprefs1#c.golder_enpp)+(2.86*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.34*c.Lprefs1#c.golder_enpp)+(4.36*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.93*c.Lprefs1#c.golder_enpp)+(2.09*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.93*c.Lprefs1#c.golder_enpp)+(2.86*c.Lprefs1#c.lijphart_execdom)
lincom c.Lprefs1+(3.93*c.Lprefs1#c.golder_enpp)+(4.36*c.Lprefs1#c.lijphart_execdom)


